package org.zfes.snowier.cloud.zbss.cms.router.service.column;

import java.util.Map;
import java.util.Optional;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.zfes.snowier.core.data.DataSet;
import org.zfes.snowier.web.controller.BaseController;
import org.zfes.snowier.cloud.zbss.cms.column.model.CmsColumnGroupContribute;
import org.zfes.snowier.cloud.zbss.cms.column.service.ICmsColumnGroupContributeService;
@Controller("org.zfes.snowier.cloud.zbss.cms.column.router.service.CmsColumnGroupContributeController")  
@RequestMapping("/cms/service/column/cmsColumnGroupContribute")
public class CmsColumnGroupContributeController extends BaseController {

	
	@Autowired
	private ICmsColumnGroupContributeService cmsColumnGroupContributeService;
	
	@RequiresPermissions(value="cmsColumnGroupContribute:loadCmsColumnGroupContributeDataSet",desc="栏目用户组发表设置列表")
    @RequestMapping(value="/loadCmsColumnGroupContributeDataSet", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadCmsColumnGroupContributeDataSet(@RequestParam Map<String,Object> params){
	    DataSet dataSet=  cmsColumnGroupContributeService.loadCmsColumnGroupContributeDataSet(params);
	    return ajaxQuery("dataSet", dataSet);
    }
	
	@RequiresPermissions(value="cmsColumnGroupContribute:createCmsColumnGroupContribute",desc="栏目用户组发表设置添加")
    @RequestMapping(value="/createCmsColumnGroupContribute", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public  @ResponseBody Object createCmsColumnGroupContribute(CmsColumnGroupContribute cmsColumnGroupContribute){
		cmsColumnGroupContributeService.createCmsColumnGroupContribute(cmsColumnGroupContribute);
    	return ajaxDoneSuccess("数据操作成功 ");
    }
	
	@RequiresPermissions(value="cmsColumnGroupContribute:loadCmsColumnGroupContribute",desc="栏目用户组发表设置加载")
    @RequestMapping(value="/loadCmsColumnGroupContribute", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadCmsColumnGroupContribute(Long id){
		Optional<CmsColumnGroupContribute> ops = cmsColumnGroupContributeService.loadCmsColumnGroupContributeById(id);
		return ajaxQuery("cmsColumnGroupContribute",ops);
    }
	
	@RequiresPermissions(value="cmsColumnGroupContribute:updateCmsColumnGroupContribute",desc="栏目用户组发表设置更新")
    @RequestMapping(value="/updateCmsColumnGroupContribute", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object updateCmsColumnGroupContribute(CmsColumnGroupContribute cmsColumnGroupContribute){
		cmsColumnGroupContributeService.updateCmsColumnGroupContribute(cmsColumnGroupContribute);
		return ajaxDoneSuccess("数据操作成功 ");
    }
	
	@RequiresPermissions(value="cmsColumnGroupContribute:deletCmsColumnGroupContribute",desc="栏目用户组发表设置删除")
    @RequestMapping(value="/deleteCmsColumnGroupContribute", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object deleteCmsColumnGroupContribute(Long id){
		cmsColumnGroupContributeService.deleteCmsColumnGroupContribute(id);
		return ajaxDoneSuccess("数据操作成功 ");
    }

}